gtk/texthandle: Handle events on parent surface's native
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 5 Nov 2020 14:11:09 +0000 (15:11 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 5 Nov 2020 20:29:20 +0000 (21:29 +0100)
commit9b9cc2f947d553e2283deab21b3b17dd2207d6b8
tree5d084d8f2bada700934745b898cf78e4744dd8d8
parent80f5be8b13adcbc295737b48df8b59802cf9a383
gtk/texthandle: Handle events on parent surface's native

In wayland, popup positioning and event handling are doubly async.
This makes it unreliable to figure out parent surface coordinates
out of the popup position and the events received. This results in
jumpy text handles there.

The best way to deal with parent surface coordinates is to handle
the events there. Make the handles transparent to input, and make
the drag gesture be set up on the parent widget's native.

The gesture is set up in the capture phase, setting it on the native
(as opposed to the parent widget) achieves a feeling similar to it
being a distinct surface, as it should take precedence over other
gestures in the emission chain (e.g. scrolledwindows).

As everything is in parent widget's native's coordinates, the drag
handles become smooth again.
gtk/gtktexthandle.c